
var str = location.search;
str = str.slice(1).split('&');
var json = {};
for (var i = 0; i < str.length; i++) {
    var a = str[i].split('=');
    json[a[0]] = a[1];
}
console.log(json);
$(function () {
    init();
    //lookUp();
});

function init() {
    $.ajax({
        type:"GET",
        url:"http://192.168.59.3:8082/console/projectcapital/getShopCapitalListDetail?merchandiseType=3&shopId="+json.shopId+"&projectCode"+json.projectCode+"&pageNum=1&pageSize=10&teamId="+json.teamId,
        contentType:"application/json",
        success:function (data) {
            console.log(data);
            $("#pjTable").bootstrapTable({
                data:JSON.parse(data).data.list
            });
        },
        error:function (err) {
            console.log(err);
        }

    });



};
function responseHandler(res) {
    console.log(res);
    var needData = {
        rows: res.data.list,//只 输出data,内容不会显示 在页面内。必须 加上.list;
        total: res.data.total
    };
    return needData;

}
function process(val,row,index){

    return "<a href='projectDetails/project.html' >"+val+"</a>";


}
function indexFmt(val,row,index){
    return index+1;
}
function pjTableQuery(params){
    params["pageNum"] = (params.offset / params.limit) + 1;
    params.pageSize = params.limit;
    console.log(params);
    return params;
}
function lookUp(res) {
    $('.form-group>input').keydown(function (e) {
        //console.log(this);
        var val = $(this).val();
        //
        var lName = $(this).prev().html().charCodeAt();
        console.log(lName);
        var names = $('#pjTable>thead>tr>th');
        //console.dir(names);
        for (var i = 1; i < names.length; i++) {
            var key = names[i].innerText.charCodeAt();
            console.log(key);
            if (key == lName) {
                // console.log(111);
                // return false;
                var items = $(names[i]).attr("data-field");

                var oHtmls = '', oTd = '';


            }
        }
    });

}


